<?php
namespace app\common\model\system;

use basic\BaseModel;
use traits\ModelTrait;

/**
 * 商户模型
 * Class SystemWxapp
 * @package app\common\model\system
 */
class SystemWxapp extends BaseModel
{
    /**
     * 主键
     * @var string
     */
    protected $pk = "wxapp_id";

    /**
     * 模型名称
     * @var string
     */
    protected $name = "system_wxapp";

    /**
     * 检测
     * @param $wxapp_id
     * @return array|\think\Model|null
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public static function checkWxapp($wxapp_id)
    {
        $where["wxapp_id"] = array("eq", $wxapp_id);
        $where["is_del"] = array("eq", 0);
        return self::where($where)->find();
    }

    use ModelTrait;
}